<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
    <!-- <script src="./lib/resource.js"></script> -->
    <script src="https://cdn.bootcss.com/vue-resource/1.3.4/vue-resource.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" :value="msg" @click='getRequest'>
    </div>
    <script>
        var vm = new Vue({
            el : '#app',
            data : {
                msg : '点我'
            },
            methods : {
                // getRequest(){
                //     this.$http.jsonp('http://localhost:8080/',{ credentials: true }).then(function(result){
                //         console.log(result.body);
                //     })
                // }
                getRequest(){
                    this.$http.get('http://ww1.studyit.io/').then(result => {
                        console.log(result.message);
                    })
                }
            }
        });
    </script>
</body>
</html>